#define CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
int main()
{
	int*p=(int*)malloc(10 * sizeof(int));
	if (p == NULL)
	{
		perror("malloc");
		return EXIT_FAILURE;
	}
	int i = 0;
	for (i = 0; i < 10; i++)
	{
		p[i] = i;
	}
	for (i = 0; i < 10; i++)
	{
		printf("%d ", p[i]);
	}
	printf("\n");

	int* p1 = realloc(p, 15 * sizeof(int));
	if(p1 == NULL)
	{
		perror("realloc");
		return EXIT_FAILURE;
	}
	p = p1;
	for (i = 0; i < 15; i++)
	{
		p[i] = 15 + i;
	}
	for (i = 0; i < 15; i++)
	{
		printf("%d ", p[i]);
	}
	printf("\n");

	free(p);
	p = NULL;
	p1 = NULL;
	return 0;


}